function $(id){
	return typeof id==='string'?document.getElementById(id):id;
}
window.onload=tab;
function tab(){
  var index=0;
  var timer=null;
var liss=document.getElementsByName("xx");
  timer=setInterval(autoPlay,1500);
  function autoPlay(){
      index++;
      if(index>=liss.length){
         index=0;
      }
      changeOption(index);
  }
  function changeOption(curIndex){
  //把之前的东西都设置为空格	                         
    for(var j=0;j<liss.length;j++){
       liss[j].style.display='none';
    }
    liss[curIndex].style.display='block';
    index=curIndex;
  }
}